﻿<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">using</span> System.Linq;

<span style="color:Green;">// keywords_base.cs</span>
<span style="color:Green;">// Accessing base class members</span>
<span style="color:Blue;">public</span> <span style="color:Blue;">class</span> LinqTest
{
    <span style="color:Blue;">public</span> <span style="color:Blue;">void</span> DoSomething()
    {
        LinqObj[] data = <span style="color:Blue;">new</span>[]
                             {
                                 <span style="color:Blue;">new</span> LinqObj { Key = <span style="color:#A31515;">&quot;abc&quot;</span>, Value = <span style="color:#A31515;">&quot;def&quot;</span> },
                                 <span style="color:Blue;">new</span> LinqObj { Key = <span style="color:#A31515;">&quot;def&quot;</span>, Value = <span style="color:#A31515;">&quot;ghi&quot;</span> }
                             };

        <span style="color:Blue;">var</span> test = <span style="color:Blue;">from</span> d <span style="color:Blue;">in</span> data
                   <span style="color:Blue;">join</span> d2 <span style="color:Blue;">in</span> data <span style="color:Blue;">on</span> d.Key <span style="color:Blue;">equals</span> d2.Key
                   <span style="color:Blue;">group</span> d <span style="color:Blue;">by</span> d.Key <span style="color:Blue;">into</span> g
                   <span style="color:Blue;">orderby</span> g.Key <span style="color:Blue;">ascending</span>, g.Key <span style="color:Blue;">descending</span>
                   <span style="color:Blue;">let</span> w = g.Key
                   <span style="color:Blue;">where</span> g.Key == <span style="color:#A31515;">&quot;abc&quot;</span>
                   <span style="color:Blue;">select</span> g;
    }

    <span style="color:Blue;">private</span> <span style="color:Blue;">class</span> LinqObj
    {
        <span style="color:Blue;">public</span> <span style="color:Blue;">string</span> Key { <span style="color:Blue;">get</span>; <span style="color:Blue;">set</span>; }
        <span style="color:Blue;">public</span> <span style="color:Blue;">string</span> Value { <span style="color:Blue;">get</span>; <span style="color:Blue;">set</span>; }
    }
}

</pre></div>